package org.example.jdk8.stream;

import java.util.ArrayList;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

public class test3 {
    public static void main(String[] args) {
        ArrayList<Object> list = new ArrayList<>(5000000);
        for (int i = 0; i < 5000000; i++) {
            list.add(UUID.randomUUID().toString());
        }
        long startTime = System.nanoTime();

        long count = list.stream().sorted().count();

        long endTime = System.nanoTime();

        System.out.println("排序耗时:" + TimeUnit.NANOSECONDS.toMillis(endTime-startTime) + "毫秒");
    }
}
